docs: add guidance on object and flattened field types#2594
Open
andrewkroh wants to merge 1 commit intoelastic:mainfrom
Open
docs: add guidance on object and flattened field types#2594andrewkroh wants to merge 1 commit intoelastic:mainfrom
andrewkroh wants to merge 1 commit intoelastic:mainfrom
Conversation
Add documentation to schemas/README.md explaining when object and flattened field types are acceptable in ECS schema definitions, and when explicit leaf fields must be used instead. Add a review checkpoint to the RFC template requiring contributors to justify any use of object or flattened types without defined children.
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add documentation clarifying when
objectandflattenedfield types areacceptable in ECS, and when explicit leaf fields must be used instead.
Motivation
The
entityfield set introduced 5 open object containers(
entity.attributes,entity.behavior,entity.lifecycle,entity.metrics,entity.raw) with zero defined children. This allowsintegrations to independently define subfields with conflicting types and
semantics, bypassing the coordination that ECS exists to provide.
The pattern is being replicated (see #2577), and the concern was raised
during review but there is no documented policy to point to.
What this establishes
An
objectwith no defined children should only be used for opaque,source-specific data with a homogeneous shape (like
labels). Aflattenedfield should be used when arbitrary keys would cause mapping explosion (like
HTTP headers). Neither is appropriate when the subfields carry semantic
meaning. In those cases, explicit leaf fields with specified types must be
defined in the schema.
The RFC template now prompts contributors to justify any use of
objectorflattenedwithout defined children.